#ifndef TASK_H_
#define TASK_H_

#include "../PackageUtils.h"
#include "../Oscar.h"
#include <wx/datetime.h>
#include "TaskHandle.h"

namespace Impp {

class Oscar;

class Task
{
protected:
	Oscar* oscar;
	
	TaskHandle handleType;
	TaskType type;
	
	qword handle;
	
private:
	time_t createTime;
	time_t lifeTime;


protected:
	Task(TaskType type, Oscar* oscar, const TaskHandle  handleType, const qword  handle, time_t lifeTime);
public:
	virtual ~Task();
	
public:
	virtual void timedOut() = 0;
	bool handleEquals(const TaskHandle & type, const qword & handle);
	virtual bool checkForTimeOut(const time_t & now);
	virtual void packageHasToWait();
	virtual void packageSent();
	TaskType getType();

protected:
	qword getHandle();
	
};

}  // namespace Impp

#endif /*TASK_H_*/
